#pragma once
#include <iostream>
#include <fstream>
class Vertex4f 
{
	float x,y,z,w;	
	float r,g,b,a;
 public:
	Vertex4f(float _x = 0, float _y = 0, float _z = 0, float _w = 0.0f){
		SetXYZW(_x,_y,_z,_w);
		SetRGBA(0.6f,0,0.3f,1);
	}
	virtual ~Vertex4f(void){}

	float GetX(void){return x;}
	float GetY(void){return y;}
	float GetZ(void){return z;}
	float GetW(void){return w;}
	void SetX(float _x){x = _x;}
	void SetY(float _y){y = _y;}
	void SetZ(float _z){z = _z;}
	void SetW(float _w){w = _w;}
	void SetXYZW(float _x, float _y, float _z, float _w){x = _x;y = _y;z = _z;w = _w;}
	
	float GetR(void){return r;}
	float GetG(void){return g;}
	float GetB(void){return b;}
	float GetA(void){return a;}
	void SetR(float _r){r = _r;}
	void SetG(float _g){g = _g;}
	void SetB(float _b){b = _b;}
	void SetA(float _a){a = _a;}
	void SetRGBA(float _r, float _g, float _b, float _a){r = _r;g = _g;b = _b;a = _a;}

	static HRESULT GetVertexBufferFromVertices();
	static HRESULT GetColorBufferFromVertices();

	friend std::istream& operator>> (std::istream& istream, Vertex4f& v)
	{
		float _x, _y, _z;
		istream>>_x>>_y>>_z;
		v.SetXYZW(_x,_y,_z,1.0f);
		return istream;
	}
};